<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>How do I declare namespaces in my feed?</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen">@import "../../css/common.css";
@import "../../css/documentation.css";</style>
<script type="text/javascript"><!-- --></script>
<link rel="start" href="http://feedvalidator.org/docs/" title="Home" />
</head>
<body>
<div id="logo">
<h1><a href="/"><span id="feed"><span id="f">F</span><span id="e1">E</span><span id="e2">E</span></span><span id="d">D</span> Validator</a></h1>
<p>Documentation</p>
<a class="skip" href="#startnavigation">Jump to navigation</a>
</div> <!--logo-->

<div id="main">

<div class="docbody">
<p>If you don't know what a namespace is, Morbus Iff has written up an excellent introduction on <a href="http://www.disobey.com/detergent/2002/extendingrss2/">Extending RSS with Namespaces</a>, which introduces the basic concepts.</p>

<p>Namespaces are <em><strong>optional</strong></em> in RSS.  If you only want the basic title-link-description in your RSS feed, you don't need namespaces.  Namespaces are an advanced concept that allow you to include all kinds of optional data in your RSS feed.  But if you use them, use them properly.</p>

<p>Here is a list of all the namespaces the validator recognizes.  (You can define your own if you know what you're doing, but the validator will not be able to validate it.)  Realistically, you won't ever have a feed that declares <em>all</em> of these.  You may not need to declare any of them.  Just declare the ones you actually use.</p>

<pre><samp>&lt;rss version="2.0"
  xmlns:access="http://www.bloglines.com/about/specs/fac-1.0"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:ag="http://purl.org/rss/1.0/modules/aggregation/"
  xmlns:annotate="http://purl.org/rss/1.0/modules/annotate/"
  xmlns:app="http://www.w3.org/2007/app"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:audio="http://media.tangent.org/rss/1.0/"
  xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"
  xmlns:company="http://purl.org/rss/1.0/modules/company"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:conversationsNetwork="http://conversationsnetwork.org/rssNamespace-1.0/"
  xmlns:cp="http://my.theinfo.org/changed/1.0/rss/"
  xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule",
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:email="http://purl.org/rss/1.0/modules/email/"
  xmlns:ev="http://purl.org/rss/1.0/modules/event/"
  xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"
  xmlns:fh="http://purl.org/syndication/history/1.0"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:foaf="http://xmlns.com/foaf/0.1"
  xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
  xmlns:georss="http://www.georss.org/georss"
  xmlns:geourl="http://geourl.org/rss/module/"
  xmlns:g="http://base.google.com/ns/1.0"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:icbm="http://postneo.com/icbm"
  xmlns:image="http://purl.org/rss/1.0/modules/image/"
  xmlns:indexing="urn:atom-extension:indexing"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:kml20="http://earth.google.com/kml/2.0"
  xmlns:kml21="http://earth.google.com/kml/2.1"
  xmlns:kml22="http://www.opengis.net/kml/2.2"
  xmlns:l="http://purl.org/rss/1.0/modules/link/"
  xmlns:mathml="http://www.w3.org/1998/Math/MathML"
  xmlns:media="http://search.yahoo.com/mrss/"
  xmlns:openid="http://openid.net/xmlns/1.0"
  xmlns:opensearch10="http://a9.com/-/spec/opensearchrss/1.0/"
  xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
  xmlns:opml="http://www.opml.org/spec2"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:ref="http://purl.org/rss/1.0/modules/reference/"
  xmlns:reqv="http://purl.org/rss/1.0/modules/richequiv/"
  xmlns:rss090="http://my.netscape.com/rdf/simple/0.9/"
  xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#"
  xmlns:rss1="http://purl.org/rss/1.0/"
  xmlns:rss11="http://purl.org/net/rss1.1#"
  xmlns:search="http://purl.org/rss/1.0/modules/search/"
  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  xmlns:ss="http://purl.org/rss/1.0/modules/servicestatus/"
  xmlns:str="http://hacks.benhammersley.com/rss/streaming/"
  xmlns:sub="http://purl.org/rss/1.0/modules/subscription/"
  xmlns:svg="http://www.w3.org/2000/svg"
  xmlns:sx="http://feedsync.org/2007/feedsync"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
  xmlns:thr="http://purl.org/rss/1.0/modules/threading/"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xrd="xri://$xrd*($v*2.0)"
  xmlns:xrds="xri://$xrds"&gt;</samp></pre>

<p>Now then, which of these will you actually use?  The most common ones are <code>dc</code>, <code>content</code>, and <code>admin</code>.  For technical reasons, if you use <code>admin</code>, you'll almost certainly end up using <code>rdf</code> too, so declare both.</p>

<p>Here is a relatively sophisticated RSS document that uses these common namespaces:</p>

<p><samp>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;rss version="2.0" <br />
&nbsp;&nbsp;xmlns:dc="http://purl.org/dc/elements/1.1/"<br />
&nbsp;&nbsp;xmlns:content="http://purl.org/rss/1.0/modules/content/"<br />
&nbsp;&nbsp;xmlns:admin="http://webns.net/mvcb/"<br />
&nbsp;&nbsp;xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;<br />
<br />
&lt;channel&gt;<br />
&lt;title&gt;My weblog&lt;/title&gt;<br />
&lt;link&gt;http://www.example.com/&lt;/link&gt;<br />
&lt;description&gt;My cute tagline&lt;/description&gt;<br />
<br />
&lt;dc:language&gt;en-us&lt;/dc:language&gt;<br />
&lt;dc:creator&gt;Me (me@example.com)&lt;/dc:creator&gt;<br />
&lt;dc:rights&gt;Copyright 2002 Me&lt;/dc:rights&gt;<br />
&lt;dc:date&gt;2002-10-18T16:10:15-05:00&lt;/dc:date&gt;<br />
<br />
&lt;admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.5" /&gt;<br />
&lt;admin:errorReportsTo rdf:resource="mailto:me@example.com"/&gt;<br />
<br />
&lt;item&gt;<br />
&lt;title&gt;Take up knitting&lt;/title&gt;<br />
&lt;link&gt;http://www.example.com/archives/000054.html&lt;/link&gt;<br />
&lt;description&gt;Hidden Mozilla preferences.  XSLT tips.  Transcript of the Eldred case.&lt;/description&gt;<br />
<br />
&lt;content:encoded&gt;&lt;![CDATA[&lt;ul&gt;<br />
&lt;li&gt;&lt;a href="http://www.geocities.com/pratiksolanki/"&gt;Hidden Mozilla prefs&lt;/a&gt;.&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="http://www.perfectxml.com/TipsXSLT.asp"&gt;50 XSLT tips&lt;/a&gt;.  [via &lt;a href="http://simon.incutio.com/"&gt;Simon&lt;/a&gt;]&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="http://www.aaronsw.com/2002/eldredTranscript"&gt;Transcript of the Eldred Supreme Court case&lt;/a&gt;.  Converted to HTML and publicly archived by &lt;a href="http://www.aaronsw.com/weblog/"&gt;Aaron&lt;/a&gt;.&lt;/li&gt;<br />
&lt;/ul&gt;]]&gt;&lt;/content:encoded&gt;<br />
<br />
&lt;dc:subject&gt;Miscellaneous&lt;/dc:subject&gt;<br />
&lt;dc:date&gt;2002-10-18T16:10:15-05:00&lt;/dc:date&gt;<br />
<br />
&lt;/item&gt;<br />
<br />
&lt;/channel&gt;<br />
&lt;/rss&gt;</samp></p>
</div>

<p class="meta">This documentation page was last updated on October 24, 2002.</p>
</div><!--main-->
<div class="centered">
<a name="startnavigation" id="startnavigation"></a>
<div class="navbarWrapper">
    <div class="navbarContent">
        <img class="borderTL" src="../../images/borderTL.gif" alt="" width="14" height="14" />
        <img class="borderTR" src="../../images/borderTR.gif" alt="" width="14" height="14" />

<p>
<a href="../../">Home</a> &middot;
<a href="../../about.html">About</a> &middot;
<a href="../../news/">News</a> &middot;
<a href="../../docs/">Docs</a> &middot;
<a href="../../terms.html">Terms</a>
</p>

        <div class="roundedCornerSpacer">&nbsp;</div>
    </div><!-- .content -->
    <div class="bottomCorners">
        <img class="borderBL" src="../../images/borderBL.gif" alt="" width="14" height="14" />
        <img class="borderBR" src="../../images/borderBR.gif" alt="" width="14" height="14" />
    </div><!-- .bottomCorners -->
</div><!-- .contentWrapper -->
</div><!-- .centered -->

<div class="centered">
<address>Copyright &copy; 2002-3 <a href="http://diveintomark.org/">Mark Pilgrim</a> and <a href="http://www.intertwingly.net/blog/">Sam Ruby</a></address>
</div>

</body>
</html>
